<!DOCTYPE html>
<html>
<head>
    <title>管理员列表</title>
    #parse("sys/header.html")
</head>
<style>
    .sugon_upload_btn {
        display: -webkit-inline-box;
        display: inline-block;
    }
    ::-webkit-scrollbar{
        width: 10px;
        height: 10px;
    }
    ::-webkit-scrollbar-thumb{
        border-radius: 10px;
        -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
        background: #a8a5a5;
    }
    .leftHeight {
        height: 85vh;
        overflow: auto;
    }
    .workShop {
        position: absolute;
        top: 0;
        width: 100%;
        height: 25px;
        background-color: white;
    }
</style>
<body>
<div id="sysUser" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                &nbsp;&nbsp;
                <i-col span="3">
                    <i-input v-model="q.userName" @on-enter="query" placeholder="用户名"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.nickName" @on-enter="query" placeholder="用户姓名"></i-input>
                </i-col>
                <i-col span="3">
                    <i-select v-model="q.special" placeholder="请选择是否特种人员">
                        <i-option value="">请选择是否特种人员</i-option>
                        <i-option value="0">否</i-option>
                        <i-option value="1">是</i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("sys:user:resetLoginTimes"))
                <i-button type="primary" @click="resetLoginTimes"><i class="fa fa-eraser"></i>&nbsp;重置登录次数</i-button>
                #end
                #if($shiro.hasPermission("sys:user:check"))
                <i-button type="primary" @click="check"><i class="fa fa-anchor"></i>&nbsp;复审</i-button>
                #end
                #if($shiro.hasPermission("sys:user:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("sys:user:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("sys:user:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
                #if($shiro.hasPermission("sys:user:imports"))
                <Upload ref="uploadFile"
                        action="../sys/user/batchImport"
                        :format ="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :show-upload-list="false"
                        :on-success="handleSuccess" :on-error="handleError"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="info"><i class="fa fa-hand-o-down"></i>&nbsp;导入</i-button>
                </Upload>
                #end
            </div>
        </Row>
        <Row :gutter="16" style="margin: 8px 0px 0px 1px;">
            <i-col :xs="3" :sm="3" :md="3" :lg="3">
                <div class="leftHeight">
                    <div class="workShop">
                        <p class="text-center" style="font-size: 15px;">车间选择</p>
                    </div>
                    <div id="storeLayer" style="margin-top: 25px">
                        <ul id="storeTree" class="ztree"></ul>
                    </div>
                </div>
            </i-col>
            <i-col :xs="21" :sm="21" :md="21" :lg="21">
                <table id="sysUserGrid"></table>
            </i-col>
        </Row>

    </div>
    <!-- 复审 -->
    <div id="reviewLayer" style="display: none;">
        <form class="form-horizontal" style="width: 350px;">
            <div class="form-group">
                <div class="form-group">
                    <div class="col-sm-4 control-label">审核状态</div>
                    <div class="col-sm-8" style="margin-top: 6px">
                        <Radio-group v-model="specUserRecord.checkResult">
                            <Radio :label="1" ><span>通过</span></Radio>
                            <Radio :label="0" ><span>不通过</span></Radio>
                        </Radio-group>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-4 control-label">原因</div>
                    <div class="col-sm-8" style="margin-top: 6px">
                        <i-input v-model="specUserRecord.reason" placeholder="原因" type="textarea"></i-input>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="user" :rules="ruleValidate" :label-width="80">
            <Form-item label="用户名" prop="userName">
                <i-input v-model="user.userName" placeholder="登录账号" :readonly="readonly"></i-input>
            </Form-item>
            <Form-item label="用户姓名" prop="nickName">
                <i-input v-model="user.nickName" placeholder="用户姓名"></i-input>
            </Form-item>
            <Form-item label="所属部门" prop="deptName">
                <i-input type="text" v-model="user.deptName" icon="md-arrow-dropdown-circle"  readonly="readonly"
                         @on-click="deptTree" readonly="readonly" placeholder="所属部门"></i-input>
            </Form-item>
            <Form-item label="角色" prop="roleIdList">
                <Checkbox-group v-model="user.roleIdList">
                    <Checkbox :label="role.roleId" v-for="role in roleList">{{role.roleName}}</Checkbox>
                </Checkbox-group>
            </Form-item>

            <Form-item label="状态" prop="status">
                <Radio-group v-model="user.status">
                    <Radio :label="0">
                        <span>禁用</span>
                    </Radio>
                    <Radio :label="1">
                        <span>正常</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="是否是领导" prop="leader">
                <Radio-group v-model="user.leader">
                    <Radio :label="0">
                        <span>否</span>
                    </Radio>
                    <Radio :label="1">
                        <span>是</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="特种人员" prop="special">
                <Radio-group v-model="user.special">
                    <Radio :label="0">
                        <span>否</span>
                    </Radio>
                    <Radio :label="1">
                        <span>是</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>
<!-- 选择部门 -->
<div id="deptLayer" style="display: none;padding:10px;">
    <ul id="deptTree" class="ztree"></ul>
</div>
<script src="${rc.contextPath}/js/sys/user.js?_${date.systemTime}"></script>
</body>
</html>
